<?php
namespace Admin\Controller;
use Think\Controller;
class ClasssController extends BaseController {
	function _before_edit(){
		$classl=M('classl')
		       ->field(array('classl_name as name','classl_id as value'))
		       ->select();
		//获取当前二级分类id和三级分类id
		$classl_id=M('classs')
		          ->where(array('classs_id'=>I('id')))
		          ->getField('classl_id');
		          

		$classm=M('classm')
		       ->where(array('classl_id'=>$classl_id))
		       ->field(array('classm_id as value','classm_name as name'))
		       ->select();
		$this->assign('classl',$classl);
		$this->assign('classm',$classm);
	}
	//获取三级分类
	function getclasss(){
        $id=I('id');
        $selectid=I('slid');
        $data=M('classs')
             ->field(array('classs_name as name','classs_id as value'))
             ->select();
        $string='';
        foreach ($data as  $value) {
            $string.='<option>'.$string;     	
         }     
	}
}              